//1!+2!+3!+..9!
//1!+3!+5!+..9!(1)
//1!!+2!!+3!!+...9!!(2)


int main(){
    int i,j;
    int sum=0;
    for(i=1; i<=9; i++){
        int  prd=1;
        for(j=1; j<=i; j++){
            prd*=j;
        }
        sum+=prd;
    }
    printf("%d\n",sum);

    return 0;
}
